<?php
class AuditAction  extends  CAction{
	
	public function run($id)
	{
		$controller = $this->getController();
		$fild = $controller->statusfild;
		$model = $controller->modelName;
		$obj = $model::model()->findByPk($id);
		$obj->attachBehaviors(
			[
				'audit'=>[
					'class'=>'application.components.behaviors.AuditBehavior',
					'statusField'=>$fild
				]
			]
		);
		$obj->audit();
		echo "<script>history.go(-1);</script>";
	}
}

?>